# 定义字典(非空)元素的列表
login_data = [
{"username": "13488888888", "password": "123456"},
{"username": "", "password": "123456"},
{"username": "13800000001", "password": ""},
{"username": "13800000001", "password": "123"}
]
# 思路：数据和业务分离的思路
# 1.先实现业务功能（函数）
def login(phone, pwd):
    if phone == "13488888888" and pwd == "123456":
        print("登录成功")
    else:
        print("登录失败")
# 再构造数据进行验证
num = 1 # 计数器
for i in login_data:
    # 获取账号密码
    phone = i.get("username")
    pwd = i.get("password")
    print(f"第{num}次测试")
    # 调用函数
    login(phone, pwd)
    num += 1 # 调用一次计数器增1